<script setup lang="ts">
defineProps<{
  loading: boolean
}>()
</script>

<template>
  <view class="relative">
    <slot />
    <view v-if="loading" class="absolute bottom-0 left-0 right-0 top-0 min-w-200rpx flex items-center justify-center bg-white">
      <slot name="loading">
        <view class="flex items-center">
          <image
            class="h-30rpx w-30rpx animate-spin"
            src="@/static/images/loading.png"
          />
          <Spacer width="12" />
          <view class="text-28rpx text-#333333 font-medium leading-28rpx">
            加载中...
          </view>
        </view>
      </slot>
    </view>
  </view>
</template>
